package com.tk.exam.utils;

import com.github.pagehelper.PageInfo;
import com.tk.exam.vo.question.resp.TkQuestionJSRespVo;
import com.tk.exam.vo.question.resp.TkQuestionPDRespVo;

import java.util.List;

public class PageInfoExt<T> extends PageInfo {
    public PageInfoExt(PageInfo pageInfo, List<T> resps) {
        setList(resps);
        setPageInfo(pageInfo);
    }
    private void setPageInfo(PageInfo pageInfo){
        setEndRow(pageInfo.getEndRow());
        setHasNextPage(pageInfo.isHasNextPage());
        setHasPreviousPage(pageInfo.isHasPreviousPage());
        setIsFirstPage(pageInfo.isIsFirstPage());
        setIsLastPage(pageInfo.isIsLastPage());
        setNavigateFirstPage(pageInfo.getNavigateFirstPage());
        setNavigateLastPage(pageInfo.getNavigateLastPage());
        setNavigatepageNums(pageInfo.getNavigatepageNums());
        setNavigatePages(pageInfo.getNavigatePages());
        setNextPage(pageInfo.getNextPage());
        setPageNum(pageInfo.getPageNum());
        setPages(pageInfo.getPages());
        setPageSize(pageInfo.getPageSize());
        setPrePage(pageInfo.getPrePage());
        setSize(pageInfo.getSize());
        setStartRow(pageInfo.getStartRow());
        setTotal(pageInfo.getTotal());
    }
}
